package Q786;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 第k个最小的素数分数
 * @author 23737
 * @time 2021.11.29
 */
public class Test {
    public static void main(String[] args) {

    }
}

class Solution {
    public int[] kthSmallestPrimeFraction(int[] arr, int k) {
        if (arr.length == 0) {
            return new int[2];
        }
        List<int[]> list = new ArrayList<>();
        for (int i = 0; i < arr.length; i++) {
            for (int j = i+1; j < arr.length; j++) {
                list.add(new int[]{arr[i],arr[j]});
            }
        }
        Collections.sort(list,(x,y) -> x[0]*y[1] - x[1]*y[0]);
        return list.get(k-1);
    }
}
